package com.ilxqx.framework.system.form.update;

import com.ilxqx.framework.system.enumeration.SysRoleDataOperationRangeEnum;
import com.ilxqx.framework.system.enumeration.SysRoleStatusEnum;
import com.ilxqx.framework.system.form.UpdateForm;
import com.ilxqx.framework.system.form.anno.Pk;
import com.ilxqx.framework.system.service.impl.SysRoleServiceImpl;
import com.ilxqx.framework.system.validator.anno.Unique;
import com.ilxqx.framework.system.validator.group.FrameworkGroups;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;

/**
 * 系统角色更新表单类
 * @author venus
 */
@Data
@Unique(message = "名称{unique}", service = SysRoleServiceImpl.class, method = "nameExists", field = "name")
public class SysRoleUpdateForm implements UpdateForm {

	/**
	 * 角色ID
	 */
	@Pk
	@NotNull(groups = FrameworkGroups.Modify.class, message = "角色ID{required}")
	@Positive(groups = FrameworkGroups.Modify.class, message = "角色ID{positive}")
	private Long roleId;

	/**
	 * 名称
	 */
	@Size(max = 16, message = "名称{size}")
	private String name;

	/**
	 * 状态
	 */
	@NotNull(message = "状态{required}")
	private SysRoleStatusEnum status;

	/**
	 * 数据操作范围
	 */
	@NotNull(message = "数据操作范围{required}")
	private SysRoleDataOperationRangeEnum dataOperationRange;

	/**
	 * 备注
	 */
	@NotBlank(message = "备注{required}")
	@Size(max = 256, message = "备注{size}")
	private String remark;

}
